#ifndef FORMLCD_H
#define FORMLCD_H

#include <QWidget>
#include <QTimer>
//#include "lvgl/examples/porting/lv_port_disp.h"
#include "Draw/drawdiagram.h"
#include "Thread/rgb_thread.h"
#include "Components/Effects/ControllerZone.h"

namespace Ui {
class FormLCD;
}

class FormLCD : public QWidget
{
    Q_OBJECT

public:
    explicit FormLCD(QWidget *parent = nullptr);
    ~FormLCD();

protected:
    virtual void paintEvent(QPaintEvent * event) override;

private:
    void draw_sina(float &Angle, const uint8_t num);
    void gridding(const int _width, const int _height, const uint16_t pix_size);
    void gridding(const int _width, const int _height, uint16_t row, uint16_t col);
    void draw_square(const int _width, const int _height, uint16_t num, uint16_t divide);
    void draw_circle(const int _width, const int _height, uint16_t divide);
    void QPaint_Test(void);
    void simulation(uint16_t row, uint16_t col);

private slots:
    void valueChange()
    {
        //lv_tick_inc(10);
        //lv_task_handler();
        if(m_value < 50)
        {
            m_value += 5;
        }
        else
        {
            m_value = 0;
        }
        update();
    }
private:
    Ui::FormLCD *ui;
    QTimer *m_time;
    int m_value = 0;
    float Angle;
    DrawDiagram Diagram;
    ControllerZone Controller;
    RGB_Thread rgbThread;
    uint16_t Bar_Cnt;
};

#endif // FORMLCD_H
